package View::Template;
use Template;

use strict;
use warnings;

=head1 NAME

View::Template - Main View

=head1 DESCRIPTION

...

=head1 FUNCTIONS

=cut

=head2 new

=cut

sub new {
    my ($class, $base) = @_;
    my %options = ( INCLUDE_PATH => $base->application->{path}."/../static", EVAL_PERL => 1 );
       $options{PRE_PROCESS}  = $base->config->{'.conf'}->{template}->{header} if $base->config->{'.conf'}->{template}->{header};
       $options{POST_PROCESS} = $base->config->{'.conf'}->{template}->{footer} if $base->config->{'.conf'}->{template}->{footer};
    return Template->new(\%options) unless Template->error();
    croak  Template->error() if Template->error();
}

=head1 AUTHOR

...

=head1 LICENSE

This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;
